package com.education.demouse.mapper;

import com.education.demouse.pojo.model.StudentAnswerDetails;
import com.education.welco.pojo.OrderPaper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 老师查看学生答题详情 持久层
 *
 * @Author: liftsail
 * @Date: 2022-10-20
 * @Description: 不积跬步无以至千里
 */
@Mapper
public interface StudentAnswerDetailsMapper {

    /**
     * 查询老师查看学生答题详情信息
     *
     * @param id 老师查看学生答题详情ID
     * @return 老师查看学生答题详情信息
     */
    public StudentAnswerDetails selectStudentAnswerDetailsById(Integer id);

    /**
     * 查询老师查看学生答题详情列表
     *
     * @param studentAnswerDetails 老师查看学生答题详情信息
     * @return 老师查看学生答题详情集合
     */
    public List<StudentAnswerDetails> selectStudentAnswerDetailsList(StudentAnswerDetails studentAnswerDetails);

    /**
     * 新增老师查看学生答题详情
     *
     * @param studentAnswerDetails 老师查看学生答题详情信息
     * @return 结果
     */
    public int insertStudentAnswerDetails(StudentAnswerDetails studentAnswerDetails);

    /**
     * 修改老师查看学生答题详情
     *
     * @param studentAnswerDetails 老师查看学生答题详情信息
     * @return 结果
     */
    public int updateStudentAnswerDetails(StudentAnswerDetails studentAnswerDetails);

    /**
     * 删除老师查看学生答题详情
     *
     * @param id 老师查看学生答题详情ID
     * @return 结果
     */
    public int deleteStudentAnswerDetailsById(Integer id);

    /**
     * 批量删除老师查看学生答题详情
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteStudentAnswerDetailsByIds(String[] ids);

    /**
     * 根据老师id查询学生答题详情列表
     *
     * @param teaId
     * @return
     */
    List<StudentAnswerDetails> queryListByTeaUserId(@Param("teaId") Integer teaId, @Param("classId") Integer classId, @Param("paperId") Integer paperId);

    List<StudentAnswerDetails> queryStatisticsListByTeaUserId(@Param("teaId") Integer teaId, @Param("classId") Integer classId, @Param("paperId") Integer paperId);

    List<StudentAnswerDetails> queryListByIds(@Param("teaId") Integer teaId, @Param("idList") Integer[] idList);

    List<OrderPaper> queryPaperListByTeaId(@Param("teaId") Integer teaId);

    /**
     * 批改试卷更新StudentAnswerDetails
     *
     * @param paperId
     * @param userId
     * @param score
     * @param comment
     * @return
     */
    int updateStudentAnswerDetailsByPaperId2StuUserId(@Param("paperId") Integer paperId, @Param("userId") Integer userId, @Param("score") BigDecimal score, @Param("comment") String comment);
}